<template>
  <div>
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-6 col-sm-offset-3">
          <h1>用户登录</h1>
          <form class="form-horizontal">
            <div class="form-group">
              <label class="col-sm-2 control-label">登录名：</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" v-model="loginName"/>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">密码：</label>
              <div class="col-sm-10">
                <input type="password"  class="form-control" v-model="password" />
              </div>
            </div>
            <button class="btn btn-primary" @click.prevent="login">登录</button>
          </form>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "login",
  data(){
    return {
      loginName: 'admin',
      password:'123456'
    }
  },
  methods:{
    login(){
      console.log('登录成功');
      this.$router.push({name: 'Index',query:{loginName:this.loginName}});
    }
  }
}

</script>

<style>
</style>
